package com.java.collection;

import org.junit.Test;

import com.collection.model.Student;

/**
 * 对象数组测试类
 * @author LC
 *
 */
public class ObjectArray {
	
	@Test
	public void testObjectArray_01() {
		
		Student[] students = new Student[6] ;
		
		Student student01 = new Student("张三01",21) ;
		Student student02 = new Student("张三02",21) ;
		Student student03 = new Student("张三03",21) ;
		Student student04 = new Student("张三04",21) ;
		
		students[0] = student01 ;
		students[1] = student02 ;
		students[2] = student03 ;
		students[3] = student04 ;
		students[4] = student02 ;
		students[5] = student03 ;
		
		//遍历输出对象数组中所有的元素
		for (int i = 0; i < students.length; i++) {
			System.out.println(students[i]);
		}
		
	}

}
